package com.wj.console.common;

import java.io.Serializable;
import java.util.List;

public class Page<Q, E> implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private int pageSize = 10;//页面大小
	private int totalNum;
	private int currentPage;
	private Q query;//请求对象
	private List<E> itemList;//结果列表
	
	public Q getQuery() {
		return query;
	}
	public void setQuery(Q query) {
		this.query = query;
	}
	public int getPageSize() {
		return pageSize;
	}
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
	public int getTotalNum() {
		return totalNum;
	}
	public void setTotalNum(int totalNum) {
		this.totalNum = totalNum;
	}
	public int getCurrentPage() {
		return currentPage;
	}
	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}
	public List<E> getItemList() {
		return itemList;
	}
	public void setItemList(List<E> itemList) {
		this.itemList = itemList;
	}
	
	public int getAllPageNum(){
		return (totalNum + this.pageSize -1 )/pageSize;
	}
	
	
}
